home *** CD-ROM | disk | FTP | other *** search
- Path: rain.fr!world-net!usenet
- From: Frederic LACHASSE <lachass@worldnet.fr>
- Newsgroups: comp.lang.c++,gnu.g++,gnu.g++.help
- Subject: Re: Overloaded new operator in C++
- Date: Sun, 18 Feb 1996 18:02:34 +0000
- Organization: World-Net information exchange, Internet provider.
- Message-ID: <VA.00000043.00701e8f@fred>
- References: <4g0boe$c37@maverick.tad.eds.com>
- Reply-To: lachass@worldnet.fr
- NNTP-Posting-Host: client56.sct.fr
- X-Newsreader: Virtual Access by Ashmount Research Ltd, http://www.ashmount.com
-
- In article <4g0boe$c37@maverick.tad.eds.com>,
- venkat@nemesis.pln.rboc.eds.com (User Jdsmith) wrote:
- >
- > I am experiencing a problem with overloading the
- > new operator when allocating an array of classes.
- >
- > I do the following and my overloaded new operator is
- > called as expected:
- >
- > ptr = new ClassThatOverloadsNew;
- >
- > But when I do this:
- >
- > ptr = new ClassThatOverloadsNew[5];
- >
- > The default new operator is called.
-
- Some compiler (generally new genaration ones) like Borland C++ 4.02 and
- 4.5, operator new and operator new[] are different, so you need to
- overload both.
-
- I hope this'll help.
-
- Frederic LACHASSE (ECP 86)
- CompuServe: 100530,2005
- Internet: lachass@worldnet.fr
-
-